//
//  ST_MeetYouModuleViewController.swift
//  btvideo
//
//  Created by mac on 2020/6/18.
//  Copyright © 2020 JarvanZhang. All rights reserved.
//

import UIKit
import SwifterSwift
import SwiftyJSON
import HandyJSON
import MBProgressHUD
import MJRefresh
import SwiftyAttributes



/**
 未读 遇见 数量
 */
var UNREAD_MEET_NUMBER:Int{
    return UNREAD_LOVE_OF_MEET + UNREAD_LOOK_OF_MEET
}

/**
 未读喜欢角标【遇见】
 */
var UNREAD_LOVE_OF_MEET = 0{
    didSet{
        ST_BTLaunchController.shared.setting_unread_msg_count()
    }
}

/**
 未读看了我角标【遇见】
 */
var UNREAD_LOOK_OF_MEET = 0{
    didSet{
        ST_BTLaunchController.shared.setting_unread_msg_count()
    }
}

/** 清空遇见
 */
func ClearUnreadOfMeetYout()  {
    UNREAD_LOOK_OF_MEET = 0
    UNREAD_LOVE_OF_MEET = 0
}

/*
class ST_MeetYouModuleViewController: UIViewController{
    
    static let shared = ST_MeetYouModuleViewController()
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
         
        
        view.addSubview(segment_control)
        segment_control.snp.makeConstraints { (make) in
            make.left.right.equalToSuperview()
            make.top.equalToSuperview()
            make.height.equalTo(ST_MeetYouSegmentControl.height)
        }
        segment_control.selected_closure = {[weak self] idx in
            self?.scrollView.setContentOffset(CGPoint.init(x: ScreenWidth*idx.cgFloat, y: 0), animated: true)
        }
        
        
        view.addSubview(scrollView)
        scrollView.snp.makeConstraints { (make) in
            make.left.right.bottom.equalToSuperview()
            make.top.equalTo(segment_control.snp.bottom)
        }
        
        scrollView.addSubview(contentView)
        contentView.snp.makeConstraints { (make) in
            make.edges.equalToSuperview()
            make.width.equalToSuperview().dividedBy(0.5)
            make.height.equalToSuperview()
        }
        
        self.addChild(love_me_controller)
        contentView.addSubview(love_me_controller.view)
        love_me_controller.view.snp.makeConstraints { (make) in
            make.width.equalTo(ScreenWidth)
            make.left.top.bottom.equalToSuperview()
        }
        
        
        self.addChild(look_me_controller)
        contentView.addSubview(look_me_controller.view)
        look_me_controller.view.snp.makeConstraints { (make) in
            make.width.equalTo(ScreenWidth)
            make.right.top.bottom.equalToSuperview()
        }
        
    }
    func refresh_data()  {
        love_me_controller.refresh_data()
        look_me_controller.refresh_data()
    }
    
//    MARK: - Properties
    fileprivate lazy var scrollView:UIScrollView = {
       let control = UIScrollView()
        control.delegate = self
        control.isPagingEnabled = true
        if #available(iOS 11.0, *) {
            control.contentInsetAdjustmentBehavior = .never
        }
        control.showsVerticalScrollIndicator = false
        control.showsHorizontalScrollIndicator = false
        
        return control
    }()
    
    fileprivate lazy var contentView:UIView = {
       let control = UIView()
        return control
    }()
    
    
    fileprivate lazy var love_me_controller:ST_MeetYouOfLoveMeViewController = {
       let control = ST_MeetYouOfLoveMeViewController()
        return control
    }()
    
    fileprivate lazy var look_me_controller:ST_MeetYouOfLookMeViewController = {
       let control = ST_MeetYouOfLookMeViewController()
        return control
    }()
    
    
    fileprivate lazy var segment_control:ST_MeetYouSegmentControl = {
       let control = ST_MeetYouSegmentControl()
        control.titleArray = ["喜欢了我","看过了我"]
        return control
    }()
}


extension ST_MeetYouModuleViewController:UIScrollViewDelegate{
    
    func scrollViewDidEndDragging(_ scrollView: UIScrollView, willDecelerate decelerate: Bool) {
                
        
        if !decelerate{
                scrollviewdidEndScroll(scrollView)
        }
    }
    
    func scrollViewDidEndDecelerating(_ scrollView: UIScrollView) {
        
            scrollviewdidEndScroll(scrollView)
        
    }
    
    
//    MARK: 停止滚动
    func scrollviewdidEndScroll(_ scrollView:UIScrollView){
        
        let currPage = (scrollView.contentOffset.x/ScreenWidth).int
        
        self.segment_control.selectBtn(index: currPage)
        
    }
    
}
*/



